# -*- python -*-
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

Import('env')

######################################################################
# Simple RPC message fragmentation tests
######################################################################
srpc_message_untrusted_nexe = env.ComponentProgram(
    'srpc_message_untrusted_test',
    env.ComponentObject('srpc_message_untrusted', 'srpc_message.c'),
    EXTRA_LIBS=[
        'srpc',
        'imc_syscalls',
        'platform',
        'gio',
        'm',
        '${PTHREAD_LIBS}',
        '${NONIRT_LIBS}'])

node = env.CommandSelLdrTestNacl('srpc_message_untrusted_test.out',
                                 srpc_message_untrusted_nexe,
                                 args=['1048576', '65536', '32'],
                                 # Pass '-a' to enable imc_makeboundsock().
                                 sel_ldr_flags=['-a'])

# TODO(ncbray) re-enable on Windows.
# http://code.google.com/p/nativeclient/issues/detail?id=3022
env.AddNodeToTestSuite(node, ['small_tests'], 'run_srpc_message_untrusted_test',
                       is_broken=env.Bit('host_windows'))
